package trunk.graph;


import com.hp.hpl.jena.graph.Triple;

import trunk.parallel.engine.opt.CostModel;
import trunk.stream.engine.util.HypTriple;

public class SimpleEdge extends Edge {

	private final int IMPO = -1;
	private HypTriple triple;
	private int distinctSubject;
	private int distinctObject;
	private int tripleCount;
	private double cost = IMPO;
	
	public SimpleEdge(Vertex v1, Vertex v2) {
		super(v1, v2);
	}
	
	public SimpleEdge(Vertex v1, Vertex v2, Triple t) {
		super(v1, v2);
		this.setTriple(t);
	}

	public void setDistinctSubject(int s) {
		distinctSubject = s;
	}
	
	public int getDistinctSubject() {
		return distinctSubject;
	}
	
	public void setDistinctObject(int o) {
		distinctObject = o;
	}
	
	public int getDistinctObject() {
		return distinctObject;
	}
	
	public void setTripleCount(int t) {
		tripleCount = t;
	}
	
	public int getTripleCount(){
		return tripleCount;
	}
	
	@Override
	public String toString() {
		return getV1().toString()+ " - " + getV2().toString();
	}

	public HypTriple getTriple() {
		return triple;
	}

	public void setTriple(Triple t) {
		this.triple = (HypTriple) t;
	}

	public double getResultSize() {
		cost = CostModel.resultSize(this);
		return cost;
	}
}
